/*
 * SRM 197 Div 1 Prob 1
 */

import java.util.*;
import java.util.regex.*;
import java.text.*;
import java.math.*;


public class GeneralChess
{
    int[] getD (String s) {
	String[] s2 = s.split (",");
	return new int[]{Integer.parseInt (s2[0]), Integer.parseInt (s2[1])};
    }
    
    boolean attackable (int[] k1, int[] k2) {
	return (k1[0]-k2[0])*(k1[0]-k2[0]) + (k1[1] - k2[1])*(k1[1] - k2[1]) == 5;
    }
    
    static int[][] dir = {
	{-2,-1},{-2,1},{-1,-2},{-1,2},
	{1,-2},{1,2}, {2,-1}, {2,1}
    };

    public String[] attackPositions(String[] pieces)
    {
	ArrayList<String> al = new ArrayList<String> ();
	
	int[][] choise = new int[8][2];
	int[] first = getD (pieces[0]);
	for (int i = 0; i < 8; ++i)
	    for (int j = 0; j < 2; ++j)
		choise[i][j] = first[j] + dir[i][j];
	
	for (int i = 1; i < pieces.length; ++i) {
	    first = getD (pieces[i]);
	    for (int j = 0; j < 8; ++j) {
		if (choise[j] != null) {
		    if (!attackable (choise[j], first)) {
			choise[j] = null;
		    }
		}
	    }
	}
	for (int j = 0; j < 8; ++j)
	    if (choise[j] != null)
		al.add (choise[j][0] + ","+choise[j][1]);
	String[] ans = new String[al.size ()];
	al.toArray (ans);
	return ans; 
    }
    

}
//Powered by KawigiEdit 2.1.4 (beta) modified by pivanof!